library(gridExtra)
library(grid)
library(tidyverse)
library(readxl)
library(ggpubr)
install.packages("gridExtra")
install.packages("gridExtra")
install.packages("grid")
install.packages("tidyverse")
install.packages("readxl")
install.packages("ggpubr")
install.packages("grid")
install.packages("grid")
library(grid)
library(tidyverse)
library(readxl)
library(ggpubr)
setwd(dirname(rstudioapi::getSourceEditorContext()$path))
getwd()
doe_data <- data.frame(read_excel("doe_result.xlsx"))
doe_data$type <- factor(doe_data$type,
levels = c("standard", "silane", "aluminate"),
ordered = TRUE)
filtered_data <- doe_data %>%
filter(doe=="modification", sample=="hornblende")
plt <- filtered_data %>%
pivot_longer(cols=c('naol_dosage', 'cs_dosage', 'modification'),
names_to='name',
values_to='value') %>% mutate(name = factor(name, levels = c('naol_dosage', 'modification', 'cs_dosage' ))) %>%
ggplot(aes(x=name, y=value, fill=type, group=type))+
geom_col(position = position_dodge(0.7),
width = 0.6)+
scale_fill_manual(labels=c("Non-functionalized\nCS in calcite\nsupernatant","Silane-\nmodified CS\nin calcite\nsupernatant","Aluminate-\nmodified CS\nin calcite\nsupernatant") ,values=c("blue", "darkgreen","orange")) +
xlab("") + ylab("Magnitude of effect (%)") +labs(fill="")+scale_x_discrete(labels=c( 'NaOl\ndosage', 'CS modification', 'CS dosage'))+
theme(legend.position = 'bottom',legend.text=element_text(size=7.1))  +
coord_cartesian(ylim = c(-12,25))+
theme(axis.line.x = element_line(colour = 'black', size=0.5, linetype='solid'),
axis.line.y = element_line(colour = 'black', size=0.5, linetype='solid'))+scale_y_continuous(breaks = c(seq(-12, 24, by =4)))+ geom_hline(yintercept=0)
ggsave("hornblende_cs_mod_effect.png",
plot = plt,
device = NULL,
path = NULL,
scale = 1,
width = 1200,
height = 1200,
units = "px",
dpi = 300,
limitsize = TRUE,
bg = NULL,
)
filtered_data <- doe_data %>%
filter(doe=="ssa", sample=="hornblende")
plt <- filtered_data %>%
pivot_longer(cols=c('naol_dosage','cs_dosage', 'quebracho', 'ssa'),
names_to='name',
values_to='value') %>% mutate(name = factor(name, levels = c('naol_dosage','cs_dosage', 'quebracho', 'ssa' ))) %>%
ggplot(aes(x=name, y=value, fill=type, group=type))+
geom_col(position = position_dodge(0.7),
width = 0.6)+
scale_fill_manual(labels=c("Aluminate-modified CS\nin calcite supernatant", "Silane-modified CS\nin calcite supernatant") ,values=c("orange", "darkgreen")) +
xlab("") + ylab("Magnitude of effect (%)") +labs(fill="")+scale_x_discrete(labels=c( 'NaOl\ndosage', 'CS dosage', 'Quebracho\ndosage', 'SSA'))+
theme(legend.position = 'bottom',legend.text=element_text(size=7.1)) +
coord_cartesian(ylim = c(-12,25))+
theme(axis.line.x = element_line(colour = 'black', size=0.2, linetype='solid'),
axis.line.y = element_line(colour = 'black', size=0.5, linetype='solid'))+scale_y_continuous(breaks = c(seq(-12, 24, by =4)))+ geom_hline(yintercept=0)
ggsave("hornblende_ssa_effect.png",
plot = plt,
device = NULL,
path = NULL,
scale = 1,
width = 1200,
height = 1200,
units = "px",
dpi = 300,
limitsize = TRUE,
bg = NULL,
)
filtered_data <- doe_data %>%
filter(doe=="ssa", sample=="hornblende")
plt <- filtered_data %>%
pivot_longer(cols=c('naol_dosage','cs_dosage', 'quebracho', 'ssa'),
names_to='name',
values_to='value') %>% mutate(name = factor(name, levels = c('naol_dosage','cs_dosage', 'quebracho', 'ssa' ))) %>%
ggplot(aes(x=name, y=value, fill=type, group=type))+
geom_col(position = position_dodge(0.7),
width = 0.6)+
scale_fill_manual(labels=c("Aluminate-modified CS\nin calcite supernatant", "Silane-modified CS\nin calcite supernatant") ,values=c("orange", "darkgreen")) +
xlab("") + ylab("Magnitude of effect (%)") +labs(fill="")+scale_x_discrete(labels=c( 'NaOl\ndosage', 'CS dosage', 'Quebracho\ndosage', 'SSA'))+
theme(legend.position = 'bottom',legend.text=element_text(size=7.1)) +
coord_cartesian(ylim = c(-12,25))+
theme(axis.line.x = element_line(colour = 'black', size=0.1, linetype='solid'),
axis.line.y = element_line(colour = 'black', size=0.5, linetype='solid'))+scale_y_continuous(breaks = c(seq(-12, 24, by =4)))+ geom_hline(yintercept=0)
ggsave("hornblende_ssa_effect.png",
plot = plt,
device = NULL,
path = NULL,
scale = 1,
width = 1200,
height = 1200,
units = "px",
dpi = 300,
limitsize = TRUE,
bg = NULL,
)
filtered_data <- doe_data %>%
filter(doe=="ssa", sample=="hornblende")
plt <- filtered_data %>%
pivot_longer(cols=c('naol_dosage','cs_dosage', 'quebracho', 'ssa'),
names_to='name',
values_to='value') %>% mutate(name = factor(name, levels = c('naol_dosage','cs_dosage', 'quebracho', 'ssa' ))) %>%
ggplot(aes(x=name, y=value, fill=type, group=type))+
geom_col(position = position_dodge(0.7),
width = 0.6)+
scale_fill_manual(labels=c("Aluminate-modified CS\nin calcite supernatant", "Silane-modified CS\nin calcite supernatant") ,values=c("orange", "darkgreen")) +
xlab("") + ylab("Magnitude of effect (%)") +labs(fill="")+scale_x_discrete(labels=c( 'NaOl\ndosage', 'CS dosage', 'Quebracho\ndosage', 'SSA'))+
theme(legend.position = 'bottom',legend.text=element_text(size=7.1)) +
coord_cartesian(ylim = c(-12,25))+
theme(axis.line.x = element_line(colour = 'black', size=0.1, linetype='solid'),
axis.line.y = element_line(colour = 'black', size=0.5, linetype='solid'))+scale_y_continuous(breaks = c(seq(-12, 24, by =4)))+ geom_hline(yintercept=0)
ggsave("hornblende_ssa_effect.png",
plot = plt,
device = NULL,
path = NULL,
scale = 1,
width = 1200,
height = 1200,
units = "px",
dpi = 300,
limitsize = TRUE,
bg = NULL,
)
filtered_data <- doe_data %>%
filter(doe=="ssa", sample=="hornblende")
plt <- filtered_data %>%
pivot_longer(cols=c('naol_dosage','cs_dosage', 'quebracho', 'ssa'),
names_to='name',
values_to='value') %>% mutate(name = factor(name, levels = c('naol_dosage','cs_dosage', 'quebracho', 'ssa' ))) %>%
ggplot(aes(x=name, y=value, fill=type, group=type))+
geom_col(position = position_dodge(0.7),
width = 0.6)+
scale_fill_manual(labels=c("Aluminate-modified CS\nin calcite supernatant", "Silane-modified CS\nin calcite supernatant") ,values=c("orange", "darkgreen")) +
xlab("") + ylab("Magnitude of effect (%)") +labs(fill="")+scale_x_discrete(labels=c( 'NaOl\ndosage', 'CS dosage', 'Quebracho\ndosage', 'SSA'))+
theme(legend.position = 'bottom',legend.text=element_text(size=7.1)) +
coord_cartesian(ylim = c(-12,25))+
theme(axis.line.x = element_line(colour = 'black', size=0.01, linetype='solid'),
axis.line.y = element_line(colour = 'black', size=0.5, linetype='solid'))+scale_y_continuous(breaks = c(seq(-12, 24, by =4)))+ geom_hline(yintercept=0)
ggsave("hornblende_ssa_effect.png",
plot = plt,
device = NULL,
path = NULL,
scale = 1,
width = 1200,
height = 1200,
units = "px",
dpi = 300,
limitsize = TRUE,
bg = NULL,
)
